package com.zzptc.llq.bdsjws.fragments;

import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;

import com.zzptc.llq.bdsjws.MyApplication;

import com.zzptc.llq.bdsjws.R;
import com.zzptc.llq.bdsjws.adapter.ContactAdapter;
import com.zzptc.llq.bdsjws.fragments.base.BaseFragmentbase;
import com.zzptc.llq.bdsjws.vo.Contact;

import java.util.ArrayList;
import java.util.List;

import butterknife.BindView;

/**
 * Created by Administrator on 2017/6/7.
 */

public class SelectContactFragment extends BaseFragmentbase {
    @BindView(R.id.rl_select_contaxt)
    RecyclerView rlSelectContaxt;
    List<Contact> contactlist=new ArrayList<Contact>();
    ContactAdapter contactAdaptery;
    @Override
    public int getXML() {
        return R.layout.select_contact_fragment;
    }

    @Override
    public void initView() {
//       //绑定数据源 项 适配器都能用
//        List<Contact> list = new ArrayList<Contact>();
//        List<Contact> alllist = MyApplication.getList();//所有数据
//        //要知道输入框中输入了什么内容
//        if (getActivity() instanceof ContactActivity) {
//        }
//        for (int i = 0; i < alllist.size(); i++) {
//
//        }
//        rlSelectContaxt.setLayoutManager(new LinearLayoutManager(getActivity()));
    }
    public void getSelectContactList(List<Contact> contacts){
        contactlist.clear();
       contactlist.addAll(contacts);
        if (contactAdaptery!=null){
            contactAdaptery.notifyDataSetChanged();
        }
    }

    @Override
    public void initDate() {
        rlSelectContaxt.setLayoutManager(new LinearLayoutManager(MyApplication.getContext()));
        //contactAdaptery=new ContactAdapter(contactlist);
        //rlSelectContaxt.setAdapter(contactAdaptery);

    }

}
